<?php
abstract class Db_Mysql extends Db
{
    public function changeDatabase($db)
    {
        $this->query('USE ' . $this->quoteDb($this->getPrefix() . $db, '`') . ';');
        return $this;
    }

    public function dropTable($table)
    {
        $this->query('DROP TABLE ' . $this->quoteTable($this->getPrefix() . $table, '`') . ';');
        return $this;
    }

    abstract protected function quote($string, $quoteChar = '\'');

    public function quoteTable($table)
    {
        return $this->quote($table, '`');
    }

    public function quoteDb($db)
    {
        return $this->quote($db, '`');
    }

    public function getSelect()
    {
        return new Db_Mysql_Select();
    }

    public function quoteAlias($alias)
    {
        return $this->quote($alias, '`');
    }
}